function clone(obj)
    local cloneObj = {}
    for k, v in ipairs(obj) do
        cloneObj[k] = v;
    end
    return cloneObj
end

-- 类
People = { }

--function People.sayHi()
--    print("hi!")
--end

People.new = function(name)
    local self = clone(People)
    self.name = name;
    return self
end

People.sayHi = function(self)
    print(self.name + " say hi!")
end

People.sayHi(People)

local people = People.new("boluo")
people:sayHi()




